/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.feedback.service.processor;

import cn.dev33.satoken.stp.StpUtil;
import info.peigen.hotpot.common.service.base.processor.Processor;
import info.peigen.hotpot.common.service.base.processor.ProcessorServiceContext;
import info.peigen.hotpot.component.feedback.domain.Feedback;
import info.peigen.hotpot.component.open.api.facade.OpenApiConstant;
import org.noear.solon.annotation.Component;

/**
 * <b>(AbstractFeedbackServiceProcessor)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/5/26
 */
@Component
public class FeedbackActiveDomainProcessor extends AbstractFeedbackServiceProcessor implements Processor {
    @Override
    public Integer level() {
        return 20;
    }

    @Override
    public void execute(ProcessorServiceContext serviceContext) {
        Feedback feedback = Feedback.init(serviceContext.getOrder());
        feedback.setCustomerId((String) StpUtil.getSession().get(OpenApiConstant.CUSTOMER_ID));
        serviceContext.setDomain(feedback);
    }
}